package pers.byxiaobai.levelhealth.listeners;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import pers.byxiaobai.levelhealth.config.ConfigData;
import pers.byxiaobai.levelhealth.permission.PermissionManager;
import pers.byxiaobai.levelhealth.utils.PlayerHealthUtil;

public class PlayerLoginListener implements Listener{
	@EventHandler
	public void onPlayerLogin(PlayerJoinEvent evt) {
		Player player=evt.getPlayer();
		if(PermissionManager.INSTANCE.hasUsePermission(player)) {
			if(ConfigData.INSTANCE.IS_ENABLE_HEALTH_SCALE)
			PlayerHealthUtil.setPlayerHealthScale(player, ConfigData.INSTANCE.HEALTH_SCALE_VALUE);
		}
	}
}
